package org.wz.complex.work.kit.file;

import cn.hutool.core.io.FileUtil;
import org.wz.complex.work.consts.PathConst;

import java.util.ArrayList;
import java.util.List;
import java.util.stream.Stream;

public interface TxtKit {

    public static void main(String[] args) {
        List<String> list = new ArrayList<>();
        FileUtil.readUtf8Lines(PathConst.DESKTOP + "content.csv", list);

        list.forEach(line -> {
            List<Integer> indexIndex = new ArrayList<>();
            indexIndex.add(0);
            String[] split = line.trim().split("#");
            Long pid = Long.parseLong(split[0].split(",")[0].trim());
            String[] subs = split[1].trim().split(",");
            Stream.of(subs).forEach(sub -> {
                indexIndex.add(0);
                System.out.println(pid + "," + sub + "," + sub + "," + (indexIndex.size() * 10 ) + "," + "son" + "," + "acer");
            });
        });
    }

}
